package com.df.tank;

import javax.imageio.ImageIO;
import java.awt.image.BufferedImage;
import java.io.IOException;

public class ImageMgr {
    public static BufferedImage goodTankL, goodTankR, goodTankU, goodTankD;
    public static BufferedImage badTankL, badTankR, badTankU, badTankD;
    public static BufferedImage bulletL, bulletR, bulletU, bulletD;
    public static BufferedImage[] explodes = new BufferedImage[16];
    public static BufferedImage[] endPics = new BufferedImage[2];
    public static BufferedImage award;

    static {
        try {
            goodTankU = ImageIO.read(ImageMgr.class.getClassLoader().getResourceAsStream("images/GoodTank1.png"));
            goodTankL = ImageUtil.rotateImage(goodTankU, -90);
            goodTankD = ImageUtil.rotateImage(goodTankL, -90);
            goodTankR = ImageUtil.rotateImage(goodTankD, -90);

            award = ImageIO.read(ImageMgr.class.getClassLoader().getResourceAsStream("images/square0.jpg"));

            badTankU = ImageIO.read(ImageMgr.class.getClassLoader().getResourceAsStream("images/BadTank1.png"));
            badTankL = ImageUtil.rotateImage(badTankU, -90);
            badTankD = ImageUtil.rotateImage(badTankL, -90);
            badTankR = ImageUtil.rotateImage(badTankD, -90);

            bulletU = ImageIO.read(ImageMgr.class.getClassLoader().getResourceAsStream("images/bulletU.png"));
            bulletL = ImageUtil.rotateImage(bulletU, -90);
            bulletD = ImageUtil.rotateImage(bulletL, -90);
            bulletR = ImageUtil.rotateImage(bulletD, -90);

            for (int i = 0; i < 16; i++) {
                explodes[i] = ImageIO.read(ImageMgr.class.getClassLoader().getResourceAsStream("images/e" + (i + 1) + ".gif"));
            }
            endPics[0]=ImageIO.read(ImageMgr.class.getClassLoader().getResourceAsStream("images/win.jpg"));

        } catch (IOException e) {
            e.printStackTrace();
        }
    }

}
